//封装ajax
function dbinary_ajax(opt,show,hide){
	
	var urls = '../'+opt.url;
	var data =opt.data;
	$.ajax({
		url : urls,
		type:"post",
		dataType:"json",
		data:data,
/*		cache:false,
		contentType:"application/json;charset=utf-8",
*/	/*	beforeSend:function(){
			if(show){
				showLoading();
			}
		},
		complete:function(){
			if(!hide){
				hideLoading();
			}
		},*/
		success:function(data){
			if(data.message.code=='success'){
				opt.success(data);
			}else{
				alert(data.message.message);
				
			}
		},
		error:function(xmlHttpRequest,textStatus,errorThrow){
			errorJson(xmlHttpRequest,textStatus,errorThrow)
		}
	})
}
function errorJson(xmlHttpRequest,textStatus,errorThrow){
	var rep = strToJson(xmlHttpRequest.responseText);

	if(rep.message.code=='500'|| xmlHttpRequest.status == 500){
		alert(rep.message.message);
	}
	
}
function strToJson(str){
	str="("+str+")";
	obj = eval(str);
	return obj;
	
}
function hideLoading(){
	$("#loading").hide();
}

function showLoading(){
	$("#loading").show();
	
}